﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameManager : MonoBehaviour
{
    public List<GameObject> DontDestroyOnLoadGoList;
    void Awake()
    {
        MyDontDestroyOnLoad();

        DataManager.GetInstance().LoadMapData();

    }

    void MyDontDestroyOnLoad()
    {
        foreach (var go in DontDestroyOnLoadGoList)
        {
            DontDestroyOnLoad(go.gameObject);
        }
    }

    void Update()
    {
        if(Input.GetKeyDown(KeyCode.Escape))
        {
            NotifyEvent e = new NotifyEvent(NotifyType.KEYCODE_BACK, null, this);
            NotifacitionCenter.GetInstance().postNotification(e);
        }
    }
}
